import coin.exchange.base.kr_rest.native_public_client_base as npubcb


class QuoinexNativePublicClient(npubcb.NativePublicClientBase):
  def __init__(self, timeout=3):
    npubcb.NativePublicClientBase.__init__(self, url="https://api.liquid.com", timeout=timeout)

  def get_ticker(self, product_id):
    return self._get_as_json("products/%s" % product_id)

  def get_orderbook(self, product_id):
    return self._get_as_json("products/%s/price_levels" % product_id)

  def get_trade(self, product_id, limit=20, page=1):
    return self._get_as_json("executions",
                             params=dict(product_id=product_id, limit=limit, page=page))

  def queryAll(self):
    return self._get_as_json("products")


if __name__ == "__main__":
  client = QuoinexNativePublicClient()
  client.queryAll()
